//引入路由组件
import Home from '@/views/Home'
import Search from '@/views/Search'
import Login from '@/views/Login'
import Register from '@/views/Register'
import Detail from '@/views/Detail'
import AddCartSuccess from '@/views/AddCartSuccess'
import ShopCart from  '@/views/ShopCart'
//路由配置信息
export default [
    {
      path:"/shopcart",//传参需占位
      name:'shopcart',
      component:ShopCart,
      meta:{show:true}
    },
    {
      path:"/addcartsuccess",//传参需占位
      name:'addcartsuccess',
      component:AddCartSuccess,
      meta:{show:true}
    },
    {
      path:"/detail/:skuid",//传参需占位
      component:Detail,
      meta:{show:true}
    },
    {
      path:"/home",
      component:Home,
      meta:{show:true}
    },
    {
      path:"/search/:keyword?",
      component:Search,
      meta:{show:true},
      name:"search"
    },
    {
      path:"/login",
      component:Login,
      meta:{show:false}
    },
    {
      path:"/register",
      component:Register,
      meta:{show:false}
    },
    //重定向，在项目跑起来的时候，访问/，立马让他定向到首页
    {
      path:'*',
      redirect:"/home",
      meta:{show:true}
    }
  ]